overall best in class
	SELECT student_id, term, session, SUM(student_avg) from result_avg WHERE class_name='SS 1 A' AND session='2017/2018' GROUP BY student_id ORDER by SUM(student_avg) DESC

if overall should come from A SET regardless of A or B then the filter for class is SELECT * FROM `class` WHERE class_name LIKE 'SS 1 %_'
the "value" of the option buttons should look like the 'LIKE' above

overal best in subject
	SELECT student_id, term, session, subject, SUM(total) from results WHERE class_name='SS 1 A' AND session='2017/2018' AND subject='Physics' GROUP BY student_id ORDER by SUM(total) DESC